package com.mini.demos.webgame.util;

import java.util.List;

import com.mini.demos.webgame.entity.Job;

public class XmlUtils {
	
	public static String transJobsXml(List<Job> jobs){
		StringBuilder xml = new StringBuilder();
		xml.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
		xml.append("<jobs>");
		for(Job job:jobs){
			xml.append("<job id=\""+job.getJobId()+"\" itempath=\""+job.getJobItemPath()+"\" ");
			xml.append("costprice=\""+job.getCostPrice()+"\" getprice=\""+job.getGetPrice()+"\" ");
			xml.append("state=\""+job.getState()+"\"/>");
		}
		xml.append("</jobs>");
		return xml.toString();
	}

}
